<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">服务内容:</label>
        <div class="col-xs-12 col-sm-10">
            <select id="c-service" class="form-control selectpicker" data-live-search="true" multiple=""
                    name="row[service_ids][]">
                {foreach name="service" item="vo"}
                <option {if in_array($vo.id,$row.service_ids)}selected{/if} value="{$vo.id}">{$vo.service_name}</option>
                {/foreach}
            </select>
            <div id="select-privew">
                <table border="1" width="100%" style="margin-top: 10px">
                    <tbody>
                    <tr>
                        <td>服务名称</td>
                        <td>标准价格</td>
                        <td>成交价格</td>
                        <td>服务周期（月）</td>
                        <td>本次收款</td>
                        <td>剩余尾款</td>
                    </tr>
                    {foreach $row.service_list as $index => $item}
                    <tr>
                        <td>{$item.service_name}</td>
                        <td>￥{$item.standard_price}</td>
                        <td><input index="{$index}" bs="{$index}_deal_price" class="form-control deal_price_ks" value="{$item.deal_price}"
                                   name="row[serviceTable][{$index}][deal_price]" placeholder="请输入成交价格"
                                   data-rule="required;" type="text"></td>
                        <td><input index="{$index}" bs="{$index}_month" class="form-control" name="row[serviceTable][{$index}][month]"
                                   placeholder="服务周期" data-rule="required" type="text" value="{$item.month}"></td>
                        <td><input index="{$index}" bs="{$index}_collection_price" class="form-control collection_price_ks"
                                   name="row[serviceTable][{$index}][collection_price]" placeholder="本次收款"
                                   data-rule="required" type="text"  value="{$item.collection_price}"></td>
                        <td><input index="{$index}" bs="{$index}_balance_price" class="form-control balance_price_ks"
                                   name="row[serviceTable][{$index}][balance_price]" placeholder="剩余尾款"
                                   data-rule="required" type="text"  value="{$item.balance_price}"></td>
                    </tr>
                    <input name="row[serviceTable][{$index}][service_id]" value="{$item.service_id}" type="hidden">
                    <input name="row[serviceTable][{$index}][ledger_expenses]" value="{$item.ledger_expenses}" type="hidden">
                    <input name="row[serviceTable][{$index}][service_name]" value="{$item.service_name}" type="hidden">
                    <input name="row[serviceTable][{$index}][standard_price]" value="{$item.standard_price}" type="hidden">
                    <input name="row[serviceTable][{$index}][cost_price]" value="{$item.cost_price}" type="hidden">
                    <input name="row[serviceTable][{$index}][corporate_type]" value="{$item.corporate_type}" type="hidden">
                    {/foreach}

                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">服务说明:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea name="row[service_desc]" class="form-control" data-rule="required" rows="5" data-tip=""
                      placeholder="请输入服务说明">{$row.service_desc|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">付款方式:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[pay_type]', ['1'=>'转账汇款','2'=>'现金'],$row.pay_type)}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">付款截图:</label>
        <div class="col-xs-12 col-sm-8">
            {:Form::image('row[pay_pic]', $row.pay_pic, ['data-rule'=>''])}
        </div>
    </div>


    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
